package com.symaster.pdfcompose.frame.page;

import com.symaster.alix.Component;
import com.symaster.alix.annotation.AlixInjection;
import com.symaster.pdfcompose.config.Data;
import com.symaster.pdfcompose.frame.component.tabs.Tabs;

import javax.swing.*;
import java.awt.*;

/**
 * @author yinmiao
 * @version 2024/4/28
 */
public class Home extends Component {

    private final JPanel rootPanel;
    private final PdfAppend pdfAppend;

    public Home() {
        this.rootPanel = new JPanel(new BorderLayout());
        Tabs tabs = new Tabs();
        pdfAppend = new PdfAppend(new Data());
        tabs.addTabCard(pdfAppend);

        this.rootPanel.add(tabs, BorderLayout.CENTER);
    }

    @AlixInjection
    public void setRunner(Runner runner) {
        runner.setPdfAppend(pdfAppend);
    }

    @Override
    public Container container() {
        return rootPanel;
    }
}
